﻿@using ModelLayer
@model ShopKart.Areas.User.Models.UserCartVm

@if (Model.UserCarts != null)
{
    for (int i = 0; i < Model.UserCarts.Count(); i++)
    {
        var uCart = Model.UserCarts.ToList()[i];
        <li>
            <a href="@Url.Action("ProductDetail", "Product", new { area = "User", productId = uCart.ProductId })">
                <span class="time">@uCart.Product.Price INR.</span>
                <span class="details">
                    <span class="label label-sm label-icon label-success">
                        <i class="fa fa-gift"></i>
                    </span> @uCart.Product.ProductName
                </span>
            </a>
        </li>
        @*if (i == 0)
            {
                @cartProduct(uCart)
                ;
            }
            else
            {
                <li class="divider"></li>
                @cartProduct(uCart)
                ;
            }*@
    }
}



@helper cartProduct(UserCart usercart)
{
    <li>
        <a href="@Url.Action("ProductDetail", "Product", new { area = "User", productId = @usercart.ProductId })">
            <div class="row">
                <div class="col-md-4"><img class="img-circle img-responsive" src="@usercart.Product.Image" /></div>
                <div class="col-md-8">
                    <strong>@usercart.Product.ProductName</strong>
                    <span class="pull-right text-muted">
                        <em>@usercart.Product.Price INR.</em>
                    </span>
                </div>

            </div>
            <div>@usercart.Product.Description</div>
        </a>
    </li>
}